<h1>Runs</h1>

<p>
<h3><%= link_to 'Results', results_path %></h3>
<p>

<table border>
  <tr>
    <th>     
      <font size="2">Mu IP</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :mu_ip, :direction => 'asc' ) ) %></font>
      <font size="1"> <%= link_to( 'v', runs_path( :order => :mu_ip, :direction => 'desc' ) ) %></font>
    </th>
    <th>      
      <font size="2">Run ID</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :id, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :id, :direction => 'desc' ) ) %></font>
    </th>
    <th>    
      <font size="2">Testbed</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :testbed_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :testbed_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>      
      <font size="2">Target</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :target_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :target_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>  
      <font size="2">Scenario</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :scenario_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :scenario_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>    
      <font size="2">Testsuite</font>
      <font size="1"><%= link_to( '^', runs_path( :order => :testsuite_name, :direction => 'asc' ) ) %></font>
      <font size="1"><%= link_to( 'v', runs_path( :order => :testsuite_name, :direction => 'desc' ) ) %></font>
    </th>
    <th>Notes</th>
    <th>Status</th>
    <th>Show</th> 
    <th>Execute</th>
    <th>Edit</th> 
    <th>Results</th>
    <th>Delete</th>
  </tr>

<% @runs.each do |run| %>
<tr valign="top" class= "<%= cycle('list-line-odd', 'list-line-even') %>">
    <td><%=h run.mu_ip %></td>
    <td><%=h run.id %></td>
    <td><%=h run.testbed_name %></td>
    <td><%=h run.target_name %></td>
    <td><%=h run.scenario_name %></td>
    <td><%=h run.testsuite_name %></td>
    <td><%=h run.metadata %></td>
    <td><%=h run.status %> </td>
    <td><%= link_to 'Show', run %></td> 
    <td><%= link_to 'Execute', :controller => "runs", :run => run, :execute => "true" %> </td>
    <td><%= link_to 'Edit', edit_run_path(run) %></td> 
    <td><%= link_to 'Results', :controller => "results", :run_id => run %> </td>
    <td><%= link_to 'Delete', run, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />
<i>create a new test run from templates on a Mu:</i>
<br />
<br />
<%= link_to 'New Run', new_run_path %> <p />
<hr />
<br />
<i>populate templates from a Mu, or clear the templates list:</i>
<br />
<div />
<form action="/runs" class="get_templates" id="new_run" method="post"><div style="margin:0;padding:0"> </div>
  <p>
    <label for="get_mu_ip">Mu IP</label>
    <input id="get_mu_ip" name="run[mu_ip]" size="12" type="text"/>
    <input id="run_submit" name="commit" type="submit" value="Get Templates/Set IP" />
  </p>
</form>


<td><%= link_to 'Clear Templates', :controller => "runs", :clear_templates => "true" %> </td>
